# -*- coding: ascii -*-
import sys
myStr1 = 'aÄBèC'
myStr2 = 'A\u00c4B\U000000e8C'
myStr3 = 'A' + chr(0xC4) + 'B' + chr(0xE8) + 'C'

print('Default encoding:', sys.getdefaultencoding())
for aStr in myStr1, myStr2, myStr3:
    print('{0}, strlen={1}, '.format(aStr, len(aStr)), end='')
    bytes1 = aStr.encode()  # Per default utf-8: 2 bytes for non-ASCII
    bytes2 = aStr.encode('latin-1')  # One byte per char
    # bytes3 = aStr.encode('ascii') # ASCII fails: outside 0..127 range
    print('byteslen1={0}, byteslen2={1}'.format(len(bytes1), len(bytes2)))
